import java.util.ArrayList;

class ArrayListTest {
	public static void main(String[] args) {
		String str1="hello";
		String str2=new String("hello");

		System.out.println(str1==str2);
		System.out.println(str1.equals(str2));

		ArrayList<String> list=new ArrayList<>();

		list.add("111");
		list.add(0,"000");
		list.add(0,"000");
		list.add(str1);
		list.remove("000");
		System.out.println(list.contains(str1));
		System.out.println(list.contains(str2));
		System.out.println(list.indexOf(str2));

		for(int i=0;i<list.size();i++) {
			System.out.print(list.get(i)+ " ");
		}
		System.out.println();

		for(String s:list) {
			System.out.print(s+ " ");
		}
		System.out.println();


	}
}
